package com.fusion.lottery.mapper.auth;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.fusion.lottery.entity.auth.Login;
import com.fusion.lottery.entity.auth.User;
import com.fusion.lottery.entity.auth.WxLogin;

public interface LoginMapper {
	
	/**
	 * 账号登录
	 * @Description: TODO
	 * @author louis
	 * @date 2018年3月29日 上午11:35:54
	 * @param token
	 * @return
	 * @throws
	 */
	@Select({"SELECT id,phone,password,salt FROM t_auth_user where phone = #{appid} and status = 0"})
	List<User> accountLogin(Login login);
	
	/**
	 * 微信用户登录
	 * @param wxLogin
	 * @return
	 */
	@Select({"SELECT id,phone,password,salt FROM t_auth_user where openId = #{openId} and status = 0"})
	List<User> wxLogin(WxLogin wxLogin);
	
	/**
	 * app登录
	 * @param appLogin
	 * @return
	 */
	@Select({"SELECT userId as id FROM t_device where code = #{code} and status = 0"})
	List<User> appLogin(@Param("code")String code);
	
}
